package com.ffcs.crmd.tsp.task.threadpool;

import com.ffcs.crmd.tsp.api.dto.job.TspJobDetailShell;
import com.ffcs.crmd.tsp.task.threadpool.api.IJobProcessRunnable;

/**
 * 
 * 功能说明:子任务处理线程组合
 *
 * @author ZHONGFUHUA
 * 
 * @since 2.0.0-SNAPSHOT
 *
 */
public class JobRunnablePair {
    
    /**
     * 通信子任务内核
     */
    private TspJobDetailShell   tspJobDetailShell;
    
    /**
     * 子任务处理的线程实现
     */
    private IJobProcessRunnable runnable;
    
    /**
     * 工作线程
     */
    private Thread              thread;
    
    public JobRunnablePair(TspJobDetailShell tspJobDetailShell, IJobProcessRunnable runnable) {
        this.tspJobDetailShell = tspJobDetailShell;
        this.runnable = runnable;
    }
    
    /**
     * 功能说明: 获取子任务处理的线程实现
     *
     * @return runnable 子任务处理的线程实现
     */
    public IJobProcessRunnable getRunnable() {
        return runnable;
    }
    
    /**
     * 功能说明: 设置子任务处理的线程实现
     *
     * @param runnable 子任务处理的线程实现
     */
    public void setRunnable(IJobProcessRunnable runnable) {
        this.runnable = runnable;
    }
    
    /**
     * 功能说明: 获取通信子任务内核
     *
     * @return jobDetailShellRemoting 通信子任务内核
     */
    public TspJobDetailShell getTspJobDetailShell() {
        return tspJobDetailShell;
    }
    
    /**
     * 功能说明: 设置通信子任务内核
     *
     * @param tspJobDetailShell 通信子任务内核
     */
    public void setTspJobDetailShell(TspJobDetailShell tspJobDetailShell) {
        this.tspJobDetailShell = tspJobDetailShell;
    }
    
    /**
     * 功能说明: 获取工作线程
     *
     * @return thread 工作线程
     */
    public Thread getThread() {
        return thread;
    }
    
    /**
     * 功能说明: 设置工作线程
     *
     * @param thread 工作线程
     */
    public void setThread(Thread thread) {
        this.thread = thread;
    }
    
}
